#include <iostream>
#include <vector>
using namespace std;

void test_vector()
{
  vector<int> v;
  v.push_back(1);
  v.push_back(2);
  //v.push_back(3);
  v.push_back(4);
  //v.push_back(5);

  vector<int>::iterator it = v.begin();

  while (it != v.end())
  {
    if (*it%2==0)
      v.erase(it);
    ++it;
  }
  for (auto e : v)
  {
    cout << e << " ";
  }
  cout << endl;
}

int main()
{
  test_vector();
  return 0;
}
